From: Jasper St. Pierre Date: Tue, 28 Jan 2014 21:47:23 +0000 (-0500) Subject: shell-app: Don't crash when trying to dispose X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2869 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=36c69124f749c48f583e8ff2413d27e10d1229e0;p=gnome-shell.git shell-app: Don't crash when trying to dispose If we dispose a ShellApp that has windows left, then we'll crash when we remove the last window, as that frees and NULLs out app->running_state. https://bugzilla.gnome.org/show_bug.cgi?id=723197 --- diff --git a/src/shell-app.c b/src/shell-app.c index 9dabeba88..dfca1d684 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -1384,11 +1384,9 @@ shell_app_dispose (GObject *object) g_clear_object (&app->info); - if (app->running_state) - { - while (app->running_state->windows) - _shell_app_remove_window (app, app->running_state->windows->data); - } + while (app->running_state) + _shell_app_remove_window (app, app->running_state->windows->data); + /* We should have been transitioned when we removed all of our windows */ g_assert (app->state == SHELL_APP_STATE_STOPPED); g_assert (app->running_state == NULL);